using System;
using SD = System.Diagnostics;

namespace AzureContrib.WindowsAzure.Diagnostics
{
	/// <summary>
	/// A trace message following the <see cref="ITrace"/>
	/// </summary>
	public class Trace : TraceBase, ITrace
	{
		
		/// <summary>
		///
		/// </summary>
		/// <param name="toLogFor"></param>
		///<param name="traceSwitchProvider"></param>
		public Trace(Type toLogFor, ITraceSwitchProvider traceSwitchProvider)
			: base(toLogFor, traceSwitchProvider)
		{ }

		/// <summary>
		///
		/// </summary>
		/// <param name="switch"></param>
		///<param name="traceSwitchProvider"></param>
		public Trace(string @switch, ITraceSwitchProvider traceSwitchProvider)
			: base(@switch, traceSwitchProvider)
		{ }

		#region Old School

		/// <summary>
		/// <see cref="SD.Trace.TraceInformation(string)"/>
		/// </summary>
		public void TraceInformation(string message)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, message));
		}

		/// <summary>
		/// <see cref="SD.Trace.TraceInformation(string,object[])"/>
		/// </summary>
		public void TraceInformation(string format, params object[] args)
		{
			if (traceSwitchProvider.InformationEnabled(this))
			{
				SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(format, args)));
			}
		}

		/// <summary>
		/// <see cref="SD.Trace.TraceWarning(string)"/>
		/// </summary>
		public void TraceWarning(string message)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, message));
		}

		/// <summary>
		/// <see cref="SD.Trace.TraceWarning(string,object[])"/>
		/// </summary>
		public void TraceWarning(string format, params object[] args)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(format, args)));
		}

		/// <summary>
		/// <see cref="SD.Trace.TraceError(string)"/>
		/// </summary>
		public void TraceError(string message)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Error, message));
		}

		/// <summary>
		/// <see cref="SD.Trace.TraceError(string,object[])"/>
		/// </summary>
		public void TraceError(string format, params object[] args)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Error, string.Format(format, args)));
		}

		/// <summary>
		/// <see cref="SD.Trace.Write(object)"/>
		/// </summary>
		public void Write(object value)
		{
			SD.Trace.Write(SwitchFormat(SD.TraceLevel.Info, value.ToString()));
		}

		/// <summary>
		/// <see cref="SD.Trace.Write(string)"/>
		/// </summary>
		public void Write(string message)
		{
			SD.Trace.Write(SwitchFormat(SD.TraceLevel.Info, message));
		}

		/// <summary>
		/// <see cref="SD.Trace.Write(object,string)"/>
		/// </summary>
		public void Write(object value, string category)
		{
			SD.Trace.Write(SwitchFormat(category, value.ToString()), category);
		}

		/// <summary>
		/// <see cref="SD.Trace"/>
		/// </summary>
		public void Write(string message, string category)
		{
			SD.Trace.Write(SwitchFormat(category, message), category);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteIf(bool,string)"/>
		/// </summary>
		public void WriteIf(bool condition, string message)
		{
			SD.Trace.WriteIf(condition, message);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteIf(bool,object,string)"/>
		/// </summary>
		public void WriteIf(bool condition, object value, string category)
		{
			SD.Trace.WriteIf(condition, SwitchFormat(category, value.ToString()), category);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteIf(bool,string,string)"/>
		/// </summary>
		public void WriteIf(bool condition, string message, string category)
		{
			SD.Trace.WriteIf(condition, message, category);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLine(object)"/>
		/// </summary>
		public void WriteLine(object value)
		{
			SD.Trace.WriteLine(value);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLine(string)"/>
		/// </summary>
		public void WriteLine(string message)
		{
			SD.Trace.WriteLine(message);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLine(object,string)"/>
		/// </summary>
		public void WriteLine(object value, string category)
		{
			SD.Trace.WriteLine(SwitchFormat(category, value.ToString()), category);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLine(string,string)"/>
		/// </summary>
		public void WriteLine(string message, string category)
		{
			SD.Trace.WriteLine(SwitchFormat(category, message), category);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLineIf(bool,object)"/>
		/// </summary>
		public void WriteLineIf(bool condition, object value)
		{
			SD.Trace.WriteLineIf(condition, value.ToString());
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLineIf(bool,string)"/>
		/// </summary>
		public void WriteLineIf(bool condition, string message)
		{
			SD.Trace.WriteLineIf(condition, message);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLineIf(bool,object,string)"/>
		/// </summary>
		public void WriteLineIf(bool condition, object value, string category)
		{
			SD.Trace.WriteLineIf(condition, value.ToString(), category);
		}

		/// <summary>
		/// <see cref="SD.Trace.WriteLineIf(bool,string,string)"/>
		/// </summary>
		public void WriteLineIf(bool condition, string message, string category)
		{
			SD.Trace.WriteLineIf(condition, SwitchFormat(category, message), category);
		}

		#endregion

		#region Verbose

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose(string message)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, message));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg>(string message, TArg arg)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(message, arg)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg>(string message, TArg arg, IFormatProvider provider)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(provider, message, arg)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2, IFormatProvider provider)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(provider, message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, IFormatProvider provider)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(provider, message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, IFormatProvider provider)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(provider, message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, IFormatProvider provider)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, IFormatProvider provider)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Verbose. Only trace if <see cref="ITraceControls.VerboseEnabled"/>.
		/// </summary>
		public void Verbose(Func<string> message)
		{
			if (traceSwitchProvider.VerboseEnabled(this)) SD.Trace.WriteLine(SwitchFormat(SD.TraceLevel.Verbose, message()));
		}

		#endregion Verbose

		#region Information

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information(string message)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, message));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg>(string message, TArg arg)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(message, arg)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg>(string message, TArg arg, IFormatProvider provider)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(provider, message, arg)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2, IFormatProvider provider)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(provider, message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, IFormatProvider provider)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(provider, message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, IFormatProvider provider)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(provider, message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, IFormatProvider provider)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, IFormatProvider provider)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Information. Only trace if <see cref="ITraceControls.InformationEnabled"/>.
		/// </summary>
		public void Information(Func<string> message)
		{
			if (traceSwitchProvider.InformationEnabled(this)) SD.Trace.TraceInformation(SwitchFormat(SD.TraceLevel.Info, message()));
		}

		#endregion Information

		#region Warning

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning(string message)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, message));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg>(string message, TArg arg)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(message, arg)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg>(string message, TArg arg, IFormatProvider provider)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(provider, message, arg)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2, IFormatProvider provider)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(provider, message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, IFormatProvider provider)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(provider, message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, IFormatProvider provider)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(provider, message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, IFormatProvider provider)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, IFormatProvider provider)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Warning. Only trace if <see cref="ITraceControls.WarningEnabled"/>.
		/// </summary>
		public void Warning(Func<string> message)
		{
			if (traceSwitchProvider.WarningEnabled(this)) SD.Trace.TraceWarning(SwitchFormat(SD.TraceLevel.Warning, message()));
		}

		#endregion Warning

		#region Error

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error(string message)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, message));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg>(string message, TArg arg)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(message, arg)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg>(string message, TArg arg, IFormatProvider provider)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(provider, message, arg)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2>(string message, TArg1 arg1, TArg2 arg2, IFormatProvider provider)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(provider, message, arg1, arg2)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, IFormatProvider provider)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(provider, message, arg1, arg2, arg3)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3, TArg4>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, IFormatProvider provider)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(provider, message, arg1, arg2, arg3, arg4)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3, TArg4, TArg5>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, IFormatProvider provider)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string message, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, IFormatProvider provider)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, string.Format(provider, message, arg1, arg2, arg3, arg4, arg5, arg6)));
		}

		/// <summary>
		/// Trace a message as Error. Only trace if <see cref="ITraceControls.ErrorEnabled"/>.
		/// </summary>
		public void Error(Func<string> message)
		{
			if (traceSwitchProvider.ErrorEnabled(this)) SD.Trace.TraceError(SwitchFormat(SD.TraceLevel.Error, message()));
		}

		#endregion Error
	}
}